package com.xncoding.pos.init;

import com.xncoding.pos.service.MessageService;
import com.xncoding.pos.service.UserService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @description:
 * @author: bo
 * @create: 2025-04-07 15:30
 */
@Component
public class AppConfig {

    @Autowired
    private UserService userService;

    @PostConstruct
    public void initStaticUtils() {
        StaticUtils.setSomeService(userService);
    }

//    StaticUtils.userService.getAll();

//    方案2：通过 ApplicationContextAware 获取上下文

}
